#pragma once
#include <iostream>
#include "SDL.h"

class SDLRenderer
{
#pragma region SINGLETON
public:
	static SDLRenderer* GetInstance()
	{
		if(instance == nullptr)
		{
			instance = new SDLRenderer();
		}
		return instance;
	}
	static void Kill()
	{
		delete instance;
		instance = nullptr;
	}
private:
	static SDLRenderer* instance;

	SDLRenderer();
	SDLRenderer(const SDLRenderer& r);
	~SDLRenderer();

	SDLRenderer& operator=(const SDLRenderer& r);
#pragma endregion
public:
	void Init();

	SDL_Renderer* GetRenderer(){ return ren; }
	int GetWidth(){ return width; }
	int GetHeight(){ return height; }

	void SetResolution(int width, int height);
	void Clear();
	void Present();

private:
	int width, height;

	SDL_Window* win;
	SDL_Renderer* ren;
};

